#pragma once

#ifdef WIN32
#include <Windows.h>
#else
#include <pthread.h>
#endif

class Lock
{
public:
	Lock(void);
	~Lock(void);

    void Lockit();
	void UnLock();


private:

#ifdef WIN32
	CRITICAL_SECTION    m_pSection;
#else
	pthread_mutex_t		m_pSection;
#endif
};


class CAutoLock
{
public:
	CAutoLock(Lock *pLock);
	~CAutoLock();
	void Destroy();

protected:
	Lock *m_pLock;
};




